<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <link rel="stylesheet" href="../../css/aui.css">
    <link rel="stylesheet" href="../../css/aliance.css">
    <link rel="stylesheet" href="../../css/index.css">
    <link rel="stylesheet" href="../../css/pulice.css">
    <style type="text/css">
    	#container {width:100%; height: 600px; }  
    </style>
    <script src="../../js/api.js"></script>
    <script src="../../js/libs/zepto.min.js"></script>
    <script src="../../js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../js/libs/swiper.min.js"></script>
    <script src="../../js/vue.min.js"></script>
    <script src="../../js/vue-resource.min.js"></script>
    <script src="../../js/aui-toast.js"></script>
    <script src="../../js/common.js" type="text/javascript" charset="utf-8"></script>
    <script type="text/javascript" src="https://webapi.amap.com/maps?v=1.4.8&key=1541c9a07778b4a05f644ce5f37391aa"></script> 
    <title>联盟商家</title>
</head>
<body>
	<div id="container"></div> 
</body>
<script type="text/javascript">
    var map, geolocation;
    //加载地图，调用浏览器定位服务
    map = new AMap.Map('container', {
        resizeEnable: true
    });
    map.plugin('AMap.Geolocation', function() {
        geolocation = new AMap.Geolocation({
            enableHighAccuracy: true,//是否使用高精度定位，默认:true
            timeout: 10000,          //超过10秒后停止定位，默认：无穷大
            buttonOffset: new AMap.Pixel(10, 30),//定位按钮与设置的停靠位置的偏移量，默认：Pixel(10, 20)
            zoomToAccuracy: true,      //定位成功后调整地图视野范围使定位位置及精度范围视野内可见，默认：false
            buttonPosition:'RB'
        });
        map.addControl(geolocation);
        geolocation.getCurrentPosition();
        AMap.event.addListener(geolocation, 'complete', onComplete);//返回定位信息
        AMap.event.addListener(geolocation, 'error', onError);      //返回定位出错信息
    });
    //解析定位结果
    var Jing=[];
    var Wei=[];
    function onComplete(data) {
        Jing.push(data.position.getLng());
        Wei.push(data.position.getLat());
        console.log(Jing);
        console.log(Wei);
    }
    //解析定位错误信息
    function onError(data) {
        alert('定位失败');
    }
    
</script>
</html>